<?php
/**
 * Create by 11li
 * Date 2020/3/11
 * Time 9:48
 *
 */

namespace app\api\controller\v1;


use app\common\controller\Api;
use app\common\service\FeedbackService;
use think\Exception;

class Feedback extends Api
{
	/**
	 * 添加反馈
	 */
	public function addFeedback()
	{
		$content = $this->request->post('content');
		!$content && $this->error('请填写反馈内容');
		
		try {
			(new FeedbackService())->addFeedback($this->auth->id, $content);
			$this->success('感谢你的反馈！');
		} catch (Exception $e) {
			$this->error('保存出错，请稍候重试');
		}
	}
}